home *** CD-ROM | disk | FTP | other *** search
- unit LBoxChk;
-
- interface
-
- uses
- Classes, Controls, Forms, Menus, StdCtrls, WinTypes,
- WinProcs, Messages, Graphics;
-
- const
- IDX_UNCHECKED = 0;
- IDX_CHECKED = 1;
- IDX_MLEFT = 0;
- IDX_MTOP = 1;
- IDX_MTEXTLEFT = 2;
- DEFAULT_HEIGHT = 17;
-
- type
- TCheckRange = IDX_UNCHECKED..IDX_CHECKED;
- TCheckBmpArray = Array[TCheckRange] of TBitMap;
-
- TMarginRange = IDX_MLEFT..IDX_MTEXTLEFT;
- TMarginArray = Array[TMarginRange] of Integer;
-
- TCheckListBox = class(TCustomListBox)
- private
- FOffsets : TMarginArray;
- FPictures : TCheckBmpArray;
- FUseFocus : Boolean;
-
- procedure CMFontChanged(var Msg: TMessage); message CM_FONTCHANGED;
- procedure ClearBitmap(Bitmap: TBitmap);
- procedure SetGlyph(Index: Integer; Value: TBitmap);
- function GetGlyph(Index: Integer): TBitmap;
- procedure SetOffset(Index: Integer; Value: Integer);
- function GetOffset(Index: Integer): Integer;
- procedure SetItemHeight;
-
- protected
- procedure DrawItem(Index: Integer;
- Rect: TRect;
- State: TOwnerDrawState); override;
-
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
-
- published
- property Align;
- property BorderStyle;
- property Color;
- property Columns;
- property Ctl3D;
- property DragCursor;
- property DragMode;
- property Enabled;
- {property ExtendedSelect;}
- property Font;
- property IntegralHeight;
- property ItemHeight;
- property Items;
- property MultiSelect;
- property ParentColor;
- property ParentCtl3D;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property Sorted;
- {property Style;}
- property TabOrder;
- property TabStop;
- property Visible;
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- {property OnDrawItem;}
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- {property OnMeasureItem;}
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
-
- property GlyphChecked : TBitmap index IDX_CHECKED read GetGlyph write SetGlyph;
- property GlyphUnchecked : TBitmap index IDX_UNCHECKED read GetGlyph write SetGlyph;
- property GlyphLeftMargin: Integer index IDX_MLEFT read GetOffset write SetOffset default 1;
- property GlyphTopMargin : Integer index IDX_MTOP read GetOffset write SetOffset default 1;
- property TextLeftMargin : Integer index IDX_MTEXTLEFT read GetOffset write SetOffset default 8;
- property ShowFocusColor : Boolean read FUseFocus write FUseFocus default False;
- end;
-
-
- implementation
- end.